package com.house.service.impl;

import com.house.mapper.HouseMapper;
import com.house.entity.House;
import com.house.service.HouseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class HouseServiceImpl implements HouseService {

    @Autowired
    private HouseMapper houseMapper;

    @Override
    public void addHouse(House house) {
        houseMapper.addHouse(house);
    }

    @Override
    public void updateHouse(House house) {
        houseMapper.updateHouse(house);
    }

    @Override
    public void deleteHouse(Long id, Long landlordId) {
        houseMapper.deleteHouse(id, landlordId);
    }

    @Override
    public List<House> getHousesByLandlord(Long landlordId) {
        return houseMapper.findHousesByLandlordId(landlordId);
    }
}

